import { createApp, h } from "vue"
import Popup from './components/popup.vue'

const obj = {
  open: () => {
    // 连接讯飞api
    console.log(111)
    const parentNode = document.createElement('div')
    const popupInstance = createApp({
      render() {
        return h(
          Popup,
          {
            //popup的属性
            removeNode: () => {
              console.log('removeNode')
              document.body.removeChild(parentNode)
            },
            reSpeak: () => {
              
            }
          }
        )
      }
    })
    document.body.appendChild(parentNode)
    popupInstance.mount(parentNode)
  }
}

export const chat = obj;